<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!--
    Ignite Spring configuration file to startup grid cache.

    When starting a standalone Ignite node, you need to execute the following command:
    {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml

    When starting Ignite from Java IDE, pass path to this file into Ignition:
    Ignition.start("examples/config/example-cache.xml");
-->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--
        Optional description.
    -->
    <description>
        Spring file for grid configuration with benchmark.
    </description>

    <!--
        Configuration below demonstrates how to setup caches within grid nodes.
    -->
    <bean id="base.grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" abstract="true">
        <property name="deploymentMode" value="SHARED"/>

        <property name="connectorConfiguration"><null/></property>

        <property name="localHost" ref="localHost"/>

        <!--
            TCP discovery SPI configuration with predefined addresses.
            Use the addresses list to provide IP addresses of initial nodes in the grid
            (at least one address must be provided).

            Note:
            =====
            If running in distributed environment, you should change IP addresses to the actual IP addresses
            of the servers on your network. Not all addresses need to be specified, only the addresses
            of one or more servers which will always be started first.
        -->
        <property name="discoverySpi" ref="discoSpi"/>
    </bean>

    <beans profile="default">
        <bean id="localHost" class="java.lang.String">
            <constructor-arg value="127.0.0.1"/>
        </bean>

        <property name="failureDetectionTimeout" value="45000"/>
        <property name="metricsUpdateFrequency" value="15000"/>

        <bean id="discoSpi" class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ackTimeout" value="5000"/>
            <property name="socketTimeout" value="5000"/>
            <property name="reconnectCount" value="5"/>

            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                    <property name="addresses">
                        <list>
                            <value>127.0.0.1:47500</value>
                        </list>
                    </property>
                </bean>
            </property>
        </bean>
    </beans>
    <beans profile="fosters">
        <!-- Empty local host value. -->
        <bean id="localHost" class="java.lang.String"/>

        <bean id="discoSpi" class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                    <property name="addresses">
                        <list>
                            <value>10.1.10.210</value>
                            <value>10.1.10.211</value>
                            <value>10.1.10.212</value>
                            <value>10.1.10.213</value>
                            <value>10.1.10.214</value>
                            <value>10.1.10.215</value>
                        </list>
                    </property>
                </bean>
            </property>
        </bean>
    </beans>
</beans>
